package org.edu.service.impl;

import java.util.List;

import org.edu.dao.LessonDao;
import org.edu.model.Lesson;
import org.edu.service.LessonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service("lessonService")
public class LessonServiceImpl implements LessonService {

	@Autowired
	private LessonDao lessonDao;
	public LessonServiceImpl() {
		// TODO Auto-generated constructor stub
	}

	@Transactional
	public void save(Lesson lesson) throws Exception {
		lessonDao.save(lesson);
	}

	@Transactional
	public void update(Lesson lesson) throws Exception {
		lessonDao.update(lesson);
	}

	@Transactional
	public void remove(Lesson lesson) throws Exception {
		lessonDao.remove(lesson);
	}

	@Transactional
	public List<Lesson> lessons() {
		return lessonDao.lessons();
	}

	@Transactional
	public Lesson findById(Long lesson_id) throws Exception {
		return lessonDao.findById(lesson_id);
	}

}
